<template>
	<u-modal v-model="visible" @confirm="$emit('confirm')" :show-cancel-button='showCancelButton' :title='title'
		:async-close="asyncClose">
		<slot></slot>
	</u-modal>
</template>

<script>
	export default {
		name: "my-modal",
		props: {
			showCancelButton: {
				type: Boolean,
				default: true
			},
			title: {
				type: String,
				default: '修改信息'
			},
			asyncClose: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				visible: false
			};
		},
		methods: {
			show() {
				this.visible = true
				this.$emit('open')
			},
			hide() {
				this.visible = false
			}
		}
	}
</script>

<style scoped lang="scss">

</style>
